<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">注册统计(分时统计)</ui:define>
    <ui:define name="content">
        <h:form>
            <p:defaultCommand target="search"/>
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="left">
                        <p:commandButton id="toggler" type="button" value="展示选择"
                                         style="width: auto;"
                                         icon="ui-icon-calculator"
                                         />
                        <p:columnToggler datasource="CreditCompensatoryOrderDataTable" trigger="toggler"
                                         />
                    </f:facet>
                    <f:facet name="right">
                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                                         update="@form"
                                         rendered="#{registerNumStatBean.isNormal() }"/>
                        <p:commandButton value="导出" icon="fa fa-download"
                                         rendered="#{registerNumStatBean.isNormal() }"
                                         ajax="false">
                            <p:dataExporter type="xls" target="CreditCompensatoryOrderDataTable" fileName="export"/>
                        </p:commandButton>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card">
                            <h1>查询条件</h1>
                            <p:panelGrid columns="8" layout="grid"
                                         columnClasses="ui-grid-col-1,ui-grid-col-1"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;">

                   				<p:outputLabel for="createStartDate" value="开始日期"/>
                                <p:calendar id="createStartDate" value="#{registerNumStatBean.$.startDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>

                                <p:outputLabel for="createEndDate" value="结束日期"/>
                                <p:calendar id="createEndDate" value="#{registerNumStatBean.$.endDate}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>

                                <p:outputLabel for="channel" value="渠道"/>
                                <p:selectCheckboxMenu id="channel" value="#{registerNumStatBean.$.channel}"
                                                      filter="true" filterMatchMode="contains"  multiple="true">
                                    <f:selectItem itemValue="" itemLabel="-请选择-"></f:selectItem>
                                    <f:selectItems value="#{registerNumStatBean.getCommProductChannels()}" var="info"
                                                   itemValue="${info.channelCode}" itemLabel="${info.channelName}"/>
                                </p:selectCheckboxMenu>
                            </p:panelGrid>
                        </div>
                        <div class="card">
                            <p:dataTable id="CreditCompensatoryOrderDataTable"
                                         style="width: 100%"
                                         var="record"
                                         value="#{registerNumStatBean.lazyDataModel}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         scrollWidth="97%"
                                         reflow="true"
                                         selection="#{registerNumStatBean.selectedRecords}"
                                         resizableColumns="true"
                                         >

                                <p:column headerText="日期">
                                    <h:outputText value="#{record.date_h}"/>
                                </p:column>
                                <p:column headerText="渠道">
                                    <h:outputText value="#{registerNumStatBean.translateProductChannel(record.channel)}"/>
                                </p:column>
                                <p:column headerText="0时">
                                    <h:outputText value="#{record.zero_h}"/>
                                </p:column>
                                <p:column headerText="1时">
                                    <h:outputText value="#{record.one_h}"/>
                                </p:column>
                                <p:column headerText="2时">
                                    <h:outputText value="#{record.two_h}"/>
                                </p:column>
                                <p:column headerText="3时">
                                    <h:outputText value="#{record.three_h}"/>
                                </p:column>
                                <p:column headerText="4时">
                                    <h:outputText value="#{record.four_h}"/>
                                </p:column>
                                <p:column headerText="5时">
                                    <h:outputText value="#{record.five_h}"/>
                                </p:column>
                                <p:column headerText="6时">
                                    <h:outputText value="#{record.six_h}"/>
                                </p:column>
                                <p:column headerText="7时">
                                    <h:outputText value="#{record.seven_h}"/>
                                </p:column>
                                <p:column headerText="8时">
                                    <h:outputText value="#{record.eight_h}"/>
                                </p:column>
                                <p:column headerText="9时">
                                    <h:outputText value="#{record.nine_h}"/>
                                </p:column>
                                <p:column headerText="10时">
                                    <h:outputText value="#{record.ten_h}"/>
                                </p:column>
                                <p:column headerText="11时">
                                    <h:outputText value="#{record.eleven_h}"/>
                                </p:column>
                                <p:column headerText="12时">
                                    <h:outputText value="#{record.twelve_h}"/>
                                </p:column>
                                <p:column headerText="13时">
                                    <h:outputText value="#{record.thirteen_h}"/>
                                </p:column>
                                <p:column headerText="14时">
                                    <h:outputText value="#{record.fourteen_h}"/>
                                </p:column>
                                <p:column headerText="15时">
                                    <h:outputText value="#{record.fifteen_h}"/>
                                </p:column>
                                <p:column headerText="16时">
                                    <h:outputText value="#{record.sixteen_h}"/>
                                </p:column>
                                <p:column headerText="17时">
                                    <h:outputText value="#{record.seventeen_h}"/>
                                </p:column>
                                <p:column headerText="18时">
                                    <h:outputText value="#{record.eighteen_h}"/>
                                </p:column>
                                <p:column headerText="19时">
                                    <h:outputText value="#{record.nineteen_h}"/>
                                </p:column>
                                <p:column headerText="20时">
                                    <h:outputText value="#{record.twenty_h}"/>
                                </p:column>
                                <p:column headerText="21时">
                                    <h:outputText value="#{record.twenty_one_h}"/>
                                </p:column>
                                <p:column headerText="22时">
                                    <h:outputText value="#{record.twenty_two_h}"/>
                                </p:column>
                                <p:column headerText="23时">
                                    <h:outputText value="#{record.twenty_three_h}"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
